#include "../../DataBase/Database.hpp"
#include <iostream>
#include <string>
#include <utility>

int main(int argc, const char** argv) {

    using namespace DBServer::Database;

    int write_buff_size = 1024 * 10;
    DataBase db{write_buff_size};

    while (1) {
      std::string command, op, key, value;
      std::cout << "input command type:<op> <key> <value>\n";
      std::cin >> op >> key;
      command = op + " " + key;
      if (op != "GET")
      {
        std::cin >> value;
        command += " " + value;
      }
      std::cout << "input command : " << command << std::endl;
      std::cout << "output        : " << db.run(std::move(command)) << std::endl;
    }

    return 0;
}